package com.ysdz.tibetan.tibetanmini.order.controller;

import com.ysdz.tibetan.tibetanmini.order.beans.Orders;
import com.ysdz.tibetan.tibetanmini.order.service.OrderService;
import com.ysdz.tibetan.tibetanmini.utils.OverallConst;
import com.ysdz.tibetan.tibetanminicommons.common.ReturnMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(OverallConst.privatePath + "/order")
public class OrderController {


    @Autowired
    private OrderService orderService;

    @PostMapping("/insert")
    public ReturnMsg insertOrder(@RequestBody Orders order){
        System.out.println(order.getProductName());
        return orderService.insertOrder(order);
    }

}
